home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
uasmls.arc
/
UASMLS.DOC
< prev
Wrap
Text File
|
1986-08-12
|
3KB
|
66 lines
UASMLS
EVER USE DEBUG TO DIS-ASSEMBLE A FILE AND SIT AROUND FOR
HOURS DOING A SIMETANEOUS DUMP TO THE PRINTER, ALL THE WHILE
WISHING YOU COULD PUT IT IN A FILE INSTEAD, AND THEM GET DOWN TO
ACTUALLY EDITING THE SOURCE CODE AND RE-ASSEMBLYING, WITH YOU
CHANGES? PIPES AND FILTERS ARE THE ANSWER.
THE DOS MANUAL SAYS PIPES "ALLOW THE SCREEN OUTPUT OF ONE
PROGRAM TO BE USED AS THE
KEYBOARD INPUT TO ANOTHER
PROGRAM....AND PIPING IS THE CHAINING OF PROGRAMS WITH AUTOMATIC
REDIRECTION OF STANDARD INPUT AND OUTPUT."
WELL, EXACTLY WHAT IS STANDARD INPUT AND OUTPUT? KEYBOARD
AND SCREEN, RESPECTIVELY. THE REDIRECTION OF STANDARD OUTPUT IS A
CINCH, JUST TELL DOS TO SEND THE OUTPUT TO A DISK FILE.
UNFORTUNATELY, THIS KILLS THE STANDARD OUTPUT TO THE SCREEN, SO
YOU DON'T KNOW WHAT YOU ARE DOING. WORKING IN THE DARK, YOU MIGHT
SAY. THIS IS WHERE THE USE OF INPUT REDIRECTION COMES INTO PLAY,
WHY NOT CREATE A SCRIPT OF DEBUG COMMANDS, USE THAT AS STANDARD
INPUT AND KICK BACK AND LET THE SCRIPT DO ALL THE WORK. THIS IS
HOW IT CAN BE DONE FOR CREATING A DEBUG DIS-ASSEMBLY FILE.
A>DEBUG
-F CS:0100 L1000 "0" <=== FILLS 1,000 BYTES WITH HEX "F"
-Q
A>DEBUG MYFILE.COM <=== LOAD THE FILE TO BE DIS-ASSEMBLED
-D <=== DUMP THE FILE, NOTE ADDRESSES
CONTAINING DATA, CONTINUE DUMPING
UNTIL YOU REACH THE END OF THE FILE
(SECTION WHEN CONTAINS CONTIGIOUS
FFFFFF'S).
-Q <=== QUIT DEBUG
A>COPY CON INFILE
U ADDR1 ADDR2 <=== START AND STOP ADDRESS
U ADDR3 ADDR4 <=== START AND STOP ADDRESS
ETC. <=== UNTIL ALL CODE ADDRESSES ARE SPECIFIED
Q <=== TELL DEBUG TO QUIT
CTRL Z <=== END OF FILE MARK
A>DEBUG MYFILE.COM <INFILE >OUTFILE
THINK OF THE PIPES AS FUNNELS. IN THIS CASE INFILE WILL BE
USED IN LIEU OF KEYBOARD INPUT TO DEBUG. ALL OUTPUT THAT WOULD
NORMALLY BE SENT TO THE SCREEN WILL BE PIPED TO A FILE CALLED
OUTFILE. OF COURSE, THE NAMES OF THESE FILES CAN BE CHANGED TO
ANY FILENAME THAT YOU WOULD LIKE TO USE.
YOU'VE NOW CREATED A FILE WHICH IS IDENTICAL TO THE
UNASSEMBLY THAT YOU WOULD NORMALLY SEE ON YOUR SCREEN. NOW RUN THE
UASMLS PROGRAM. THE PROGRAM WILL ASK FOR THE INPUT FILE. ENTER
OUTFILE. WHEN ASKED FOR THE OUTPUT FILE NAME ENTER A NEW
FILENAME, USUALLY WITH A .ASM EXTENSION. THE PROGRAM WILL THEN
READ OUTFILE, ELIMINATE THE HEX ADDRESSES ON THE LEFT AND ASSIGN
LABELS (IN THE FORM LN, WHERE N = 1 - 999) FOR ALL JUMPS AND
CALLS, AND SEND THE RESULTS TO THE NEW FILE YOU HAVE SPECIFIED.
IF YOU GET AN ERROR MESSAGE "ERROR: REFERENCED CODE NOT
FOUND:", IT MEANS THAT A JUMP OR CALL WAS FOUND WHICH REFERENCED
AN ADDRESS NOT FOUND IN THE INPUT FILE. THIS MEANS YOU MISSED
PORTIONS OF THE CODE, YOU STARTED UNASSEMBLING IN THE MIDDLE OF
AN INSTRUCTION, OR YOU GOT INTO DATA AREAS.